﻿/******************************************************************************
* File description: DBMaintenance.qml
* Function: 打靶维护校正页面
* Current Version: 1.1
* Author: 陈乃瑞
* Date: 2025-07-01
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Controls 2.12
import QtMultimedia 5.14

import "../animation/practiceAnimation"

Rectangle{
    id: root
    //    title: "维护校正"
    width: parent.width
    height:  parent.height
    color: "white"
    radius: 12
    //    minimumWidth: 1430*dp
    //    minimumHeight: 860*dp
    //    maximumWidth: 1430*dp
    //    maximumHeight: 860*dp
    property int flagwh: 1
    property int flagcs: 1
    property int flagwc: 1
    property int gdwh: 1
    property int gdcs: 1
    property int gdwc: 1
    property int gzsj: 0
    property int gzfl: 0
    property int alldcf: 0
    property int zhyd: 0
    // 倒计时剩余时间（秒）
    property int remainingSeconds: 0
    // 计时器是否正在运行
    property bool isRunning: false
    property string xbzhv: ""
    property string jsdhbv: ""
    property string stzhyxzhv: ""
    property string gzzhv: ""
    property string lqzhv: ""

    // 计时器
    Timer {
        id: timer
        interval: 1000  // 1秒触发一次
        repeat: true
        onTriggered: {
            remainingSeconds -= 1
            if (remainingSeconds <= 0) {
                stop()
                isRunning = false
                remainingSeconds = 0
            }
        }
    }
    // 格式化时间为 分:秒
    function formatTime(seconds) {
        var mins = Math.floor(seconds / 60)
        var secs = seconds % 60
        return mins.toString().padStart(2, '0') + ":" + secs.toString().padStart(2, '0')
    }
    DBMaintenancePop{
        id:dbMaintenancePop
    }

    onVisibleChanged: {

    }

    Connections{  // qmlre;
        target: CSignal
        onRefCommunicationLog:{
            logtab.setData(CMaintenance.getLog())
        }
//        onGetHeliumGasPump:{
//            hqyl.setText(pressureValue)
//        }
        onDbhqGetAir:{
            hqvalue.setText(airValue)
        }
        onDbxqbGetAir:{
            xqbvalue.setText(airValue)
        }
        onTargetPadPumpValue:{
            dbxbyl.setText(yl)
        }
        onTargetGasPumpValue:{
            dbqdyl.setText(value)
        }
        onTargetArgonPumpValue:{
            dbhqyl.setText(yl)
        }
        onDbGzwh:{
            if(gzfl===1){
                // 开始计时
                var minutes = parseInt(gzsj)
                if (minutes > 0) {
                    remainingSeconds = minutes * 60
                    isRunning = true
                    timer.start()
                }
                CAnimationPractice.openPump1()
            }
        }
        onDblsj:{
            lsj3.setText(lsjyl)
        }
        onDbcgqsl:{
            cgqsl.setText(cgqslv)
        }
    }
    Connections{  // qmlre
        target: CMaintenance
        onDellog:{
            logtab.setData(CMaintenance.getLog())
        }
    }
    Connections{
        target: CSignal
        onSendResetMsg:{
            if(status==="0"){
                maintenanceToast.show("复位完成",0)
            }
            else if(status==="1"){
                maintenanceToast.show("正在进行复位,请耐心等待",2)
            }
        }
    }

    CustomPopupBoxWarning{
        id: qdhfcs
        box_text: "确认恢复初始状态吗?"
        onAccepted: {

        }
    }
    CustomPopupBoxWarning{
        id: qdfw
        box_text: "确认复位吗?"
        onAccepted: {
            CMaintenance.reset("0","11","")
        }
    }
    CustomPopupBoxWarning{
        id: qdxf
        box_text: "确认数据下发吗?"
        onAccepted: {
            CMaintenance.saveData(2)
        }
    }
    Rectangle{
        x:10*dp
        y:10*dp
        width: parent.width-2*x
        height: parent.height-2*x
        Rectangle{
            x:0*dp
            y:0*dp
            width: parent.width*0.7
            height: parent.height
            ScrollView{
                y:2*dp
                id: scrollView
                width: parent.width
                height: parent.height-4*dp
                clip: true
                Column{
                    id: columnLayout
                    x:2*dp
                    y:0*dp
                    width: parent.width-4*dp
                    height: parent.height-4*dp
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("氦气泵气压维护")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:hqtype
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开阀门","关阀门"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                            CustomInputText{
                                id:hqvalue
                                x:205*dp
                                y:2*dp
                                titleWidth: 100*dp
                                editWidth: 100*dp
                                title: "压力值(MPa):"
                                prompt:"10-10000"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setHqAir(hqtype.text,hqvalue.getText())
                                    }else{
                                        CMaintenance.getHqAir(hqtype.text)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("吸靶材气压维护")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:xqbtype
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开阀门","关阀门"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                            CustomInputText{
                                id:xqbvalue
                                x:205*dp
                                y:2*dp
                                titleWidth: 100*dp
                                editWidth: 100*dp
                                title: "压力值(MPa):"
                                prompt:"10-10000"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setXqbAir(xqbtype.text,xqbvalue.getText())
                                    }else{
                                        CMaintenance.getXqbAir(xqbtype.text)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("冷水机流量维护")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:lsj1
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开阀门","关阀门"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                            CustomRadioGroup{
                                id:lsj2
                                x:205*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["进口","出口"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                            CustomInputText{
                                id:lsj3
                                x:385*dp
                                y:2*dp
                                titleWidth: 100*dp
                                editWidth: 100*dp
                                title: "压力值(MPa):"
                                prompt:"10-10000"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setlsjll(lsj1.text,lsj3.getText(),lsj2.text)
                                    }else{
                                        CMaintenance.getlsjll(lsj1.text,lsj2.text)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("进料气缸")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:jlqg
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["上移","下移"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.maintenanceAction(jlqg.text==="上移"?"梭体上靶上移":"梭体上靶下移")
                                    if(jlqg.text==="上移"){
                                        CAnimationPractice.feedPortUp()
                                    }else{
                                        CAnimationPractice.feedPortDown()
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("旋转气缸")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:xzqg
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["垂直","水平"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.maintenanceAction(xzqg.text==="垂直"?"水冷头旋转(垂直)":"水冷头旋转(水平)")
                                    if(xzqg.text==="垂直"){
                                        CAnimationPractice.openBrake()
                                    }else{
                                        CAnimationPractice.closeBrake()
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("送靶气缸")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:sbqg
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["退靶","进靶"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.maintenanceAction(sbqg.text)
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("气路传感器数量")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomInputText{
                                id:cgqsl
                                x:5*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "数量:"
                                prompt:"1-5"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setcgqsl(cgqsl.getText())
                                    }else{
                                        CMaintenance.getcgqsl()
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 86*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            color: "#FAFAFA"
                            Text {
                                text: qsTr("吸靶(组合)")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 86 * dp
                            CustomRadioGroup{
                                id:xbzh
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开启","关闭"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                                onCliccc: {
                                    xbzhv=""
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:44*dp
                                width: 100*dp
                                title: "负压阀1开启"
                                button_color : xbzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xbzhv=title
                                    xbzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:115*dp
                                y:44*dp
                                width: 100*dp
                                title: "负压阀1关闭"
                                button_color : xbzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xbzhv=title
                                    xbzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:225*dp
                                y:44*dp
                                width: 100*dp
                                title: "负压阀2开启"
                                button_color : xbzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xbzhv=title
                                    xbzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:335*dp
                                y:44*dp
                                width: 100*dp
                                title: "负压阀2关闭"
                                button_color : xbzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xbzhv=title
                                    xbzh.checkedIndex=-1
                                }
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    if(xbzhv===""){
                                        if(xbzh.text==="开启"){
                                            CMaintenance.maintenanceAction("吸取梭体开启")
                                        }else{
                                            CMaintenance.maintenanceAction("吸取梭体关闭")
                                        }
                                    }else{
                                        CMaintenance.maintenanceAction(xbzhv)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 86*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            color: "#FAFAFA"
                            Text {
                                text: qsTr("加速端回靶(组合)")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 86 * dp
                            CustomRadioGroup{
                                id:jsdhb
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开启","关闭"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                                onCliccc: {
                                    jsdhbv=""
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:44*dp
                                width: 100*dp
                                title: "正压阀1开启"
                                button_color : jsdhbv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    jsdhbv=title
                                    jsdhb.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:115*dp
                                y:44*dp
                                width: 100*dp
                                title: "正压阀1关闭"
                                button_color : jsdhbv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    jsdhbv=title
                                    jsdhb.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:225*dp
                                y:44*dp
                                width: 100*dp
                                title: "正压阀2开启"
                                button_color : jsdhbv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    jsdhbv=title
                                    jsdhb.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:335*dp
                                y:44*dp
                                width: 100*dp
                                title: "正压阀2关闭"
                                button_color : jsdhbv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    jsdhbv=title
                                    jsdhb.checkedIndex=-1
                                }
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    if(jsdhbv===""){
                                        if(jsdhb.text==="开启"){
                                            CMaintenance.maintenanceAction("加速端回靶启动")
                                            CAnimationPractice.openBlowTarget()
                                        }else{
                                            CMaintenance.maintenanceAction("加速端回靶停止")
                                            CAnimationPractice.closeBlowTarget()
                                        }
                                    }else{
                                        CMaintenance.maintenanceAction(jsdhbv)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 86*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            color: "#FAFAFA"
                            Text {
                                text: qsTr("梭体组合运行(组合)")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 86 * dp
                            CustomRadioGroup{
                                id:stzhyx
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["一键进靶","一键退靶"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                                onCliccc: {
                                    stzhyxzhv=""
                                    if(checkedIndex===0){
                                        zhyd=0
                                    }else if(checkedIndex===1){
                                        zhyd=1
                                    }
                                }
                            }
                            CustomButton{
                                visible: zhyd===0
                                x:5*dp
                                y:44*dp
                                width: 100*dp
                                title: "1吸取梭体开"
                                button_color : stzhyxzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    stzhyxzhv=title
                                    stzhyx.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                visible: zhyd===0
                                x:115*dp
                                y:44*dp
                                width: 100*dp
                                title: "2水冷头水平"
                                button_color : stzhyxzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    stzhyxzhv=title
                                    stzhyx.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                visible: zhyd===0
                                x:225*dp
                                y:44*dp
                                width: 100*dp
                                title: "3进靶"
                                button_color : stzhyxzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    stzhyxzhv=title
                                    stzhyx.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                visible: zhyd===0
                                x:335*dp
                                y:44*dp
                                width: 100*dp
                                title: "4吸取梭体关"
                                button_color : stzhyxzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    stzhyxzhv=title
                                    stzhyx.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                visible: zhyd===1
                                x:5*dp
                                y:44*dp
                                width: 100*dp
                                title: "1吸取梭体开"
                                button_color : stzhyxzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    stzhyxzhv=title
                                    stzhyx.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                visible: zhyd===1
                                x:115*dp
                                y:44*dp
                                width: 100*dp
                                title: "2退靶"
                                button_color : stzhyxzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    stzhyxzhv=title
                                    stzhyx.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                visible: zhyd===1
                                x:225*dp
                                y:44*dp
                                width: 100*dp
                                title: "3水冷头垂直"
                                button_color : stzhyxzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    stzhyxzhv=title
                                    stzhyx.checkedIndex=-1
                                }
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    if(stzhyxzhv===""){
                                        if(stzhyx.text==="一键进靶"){
                                            CMaintenance.maintenanceAction("梭体组合运行一键进靶")
                                             CAnimationPractice.oneButtonInTarget()
                                        }else{
                                            CMaintenance.maintenanceAction("梭体组合运行一键退靶")
                                            CAnimationPractice.oneButtonOutTarget()
                                        }
                                    }else{
                                        if(stzhyxzhv==="1吸取梭体开"){
                                            CMaintenance.maintenanceAction("吸取梭体开启")
                                        }else if(stzhyxzhv==="2水冷头水平"){
                                            CMaintenance.maintenanceAction("水冷头旋转(水平)")
                                            CAnimationPractice.turnWheelLeft()
                                        }else if(stzhyxzhv==="3进靶"){
                                            CMaintenance.maintenanceAction("进靶")
                                            CAnimationPractice.barMoveLeft()
                                        }else if(stzhyxzhv==="4吸取梭体关"){
                                            CMaintenance.maintenanceAction("吸取梭体关闭")
                                        }else if(stzhyxzhv==="2退靶"){
                                            CMaintenance.maintenanceAction("退靶")
                                            CAnimationPractice.barMoveRight()
                                        }else if(stzhyxzhv==="3水冷头垂直"){
                                            CMaintenance.maintenanceAction("水冷头旋转(垂直)")
                                            CAnimationPractice.turnWheelDown()
                                        }
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 224*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 224 * dp
                            color: "#FAFAFA"
                            Text {
                                text: qsTr("干燥(组合)")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 224 * dp
                            CustomRadioGroup{
                                id:gzzh
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开启","关闭"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                                onCliccc: {
                                    gzzhv=""
                                }
                            }
                            CustomInputText{
                                id:gzsj
                                x:170*dp
                                y:2*dp
                                titleWidth: 120*dp
                                editWidth: 100*dp
                                title: "时间(min):"
                                prompt:"6-10000"
                            }
                            CustomButton{
                                x:5*dp
                                y:44*dp
                                width: 110*dp
                                title: "水路阀3开启"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:125*dp
                                y:44*dp
                                width: 110*dp
                                title: "水路阀3关闭"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:245*dp
                                y:44*dp
                                width: 110*dp
                                title: "正压阀2开启"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:365*dp
                                y:44*dp
                                width: 110*dp
                                title: "正压阀2关闭"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:485*dp
                                y:44*dp
                                width: 110*dp
                                title: "正压阀3开启"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:86*dp
                                width: 110*dp
                                title: "正压阀3关闭"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:125*dp
                                y:86*dp
                                width: 110*dp
                                title: "负压阀1开启"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:245*dp
                                y:86*dp
                                width: 110*dp
                                title: "负压阀1关闭"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:365*dp
                                y:86*dp
                                width: 110*dp
                                title: "负压阀2开启"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:485*dp
                                y:86*dp
                                width: 110*dp
                                title: "负压阀2关闭"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:128*dp
                                width: 110*dp
                                title: "正压阀1开启"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:125*dp
                                y:128*dp
                                width: 110*dp
                                title: "正压阀1关闭"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:245*dp
                                y:128*dp
                                width: 110*dp
                                title: "水路阀2开启"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:365*dp
                                y:128*dp
                                width: 110*dp
                                title: "水路阀2关闭"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:485*dp
                                y:128*dp
                                width: 110*dp
                                title: "氦气阀1开启"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:170*dp
                                width: 110*dp
                                title: "氦气阀1关闭"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:125*dp
                                y:170*dp
                                width: 110*dp
                                title: "氦气阀2开启"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:245*dp
                                y:170*dp
                                width: 110*dp
                                title: "氦气阀2关闭"
                                button_color : gzzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    gzzhv=title
                                    gzzh.checkedIndex=-1
                                }
                            }


                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 224 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    if(gzzhv===""){
                                        if(gzzh.text==="开启"){
                                            CMaintenance.dry(gzsj.getText(),"开")
                                            CAnimationPractice.openPump2()
                                            CAnimationPractice.openPumpHe()
                                        }else{
                                            CMaintenance.dry(gzsj.getText(),"关")
                                            CAnimationPractice.closePump2()
                                            CAnimationPractice.closePumpHe()
                                        }
                                    }else{
                                        CMaintenance.maintenanceAction(gzzhv)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 128*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 128 * dp
                            color: "#FAFAFA"
                            Text {
                                text: qsTr("冷却(组合)")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 128 * dp
                            CustomRadioGroup{
                                id:lq1
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["水气全开","水气全关"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                                onCliccc: {
                                    lqzhv=""
                                    lq2.checkedIndex=0
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:44*dp
                                width: 110*dp
                                title: "水路阀1开启"
                                button_color : lqzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    lqzhv=title
                                    lq1.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:125*dp
                                y:44*dp
                                width: 110*dp
                                title: "水路阀1关闭"
                                button_color : lqzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    lqzhv=title
                                    lq1.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:245*dp
                                y:44*dp
                                width: 110*dp
                                title: "水路阀2开启"
                                button_color : lqzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    lqzhv=title
                                    lq1.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:365*dp
                                y:44*dp
                                width: 110*dp
                                title: "水路阀2关闭"
                                button_color : lqzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    lqzhv=title
                                    lq1.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:485*dp
                                y:44*dp
                                width: 110*dp
                                title: "水冷机开启"
                                button_color : lqzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    lqzhv=title
                                    lq1.checkedIndex=-1
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:86*dp
                                width: 110*dp
                                title: "水冷机关闭"
                                button_color : lqzhv===title?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    lqzhv=title
                                    lq1.checkedIndex=-1
                                }
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 128 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    if(lqzhv===""){
                                        CMaintenance.maintenanceAction(lq1.text)
                                    }else{
                                        CMaintenance.maintenanceAction(lqzhv)
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        Rectangle{
            x:parent.width*0.7+1*dp
            y:2*dp
            width: parent.width*0.3
            height: parent.height
            border.width: 1
            border.color: "#B8B7B5"
            Rectangle{
                x:0*dp
                y:0*dp
                width: parent.width
                height: parent.height*0.2
                border.width: 1
                border.color: "#B8B7B5"
                CustomButton{
                    x:5*dp
                    y:20*dp
                    width: (parent.width-20*dp)/3
                    button_color: "#F2F2F2"
                    button_icon: "qrc:/picture/maintain/fw.png"
                    title: "复位"
                    onReleased: {
                        qdfw.show()
                    }
                }
                CustomButton{
                    x:10*dp+(parent.width-20*dp)/3
                    y:20*dp
                    width: (parent.width-20*dp)/3
                    button_color: "#F2F2F2"
                    button_icon: "qrc:/picture/maintain/xf.png"
                    title: "下发"
                    onReleased: {
                        qdxf.show()
                    }
                }
                CustomButton{
                    x:15*dp+(parent.width-20*dp)/3*2
                    y:20*dp
                    width: (parent.width-20*dp)/3
                    button_color: "#F2F2F2"
                    button_icon: "qrc:/picture/maintain/zt.png"
                    title: "状态获取"
                    onReleased: {
                        statepop.show()
                    }
                }
                CustomButton{
                    x:5*dp
                    y:80*dp
                    width: (parent.width-20*dp)/3
                    button_color: alldcf===0?"#F2F2F2":"#67C23A"
                    button_icon: "qrc:/picture/maintain/dcf.png"
                    title: "所有电磁阀"
                    onReleased: {
                        if(alldcf===0){
                            CMaintenance.dbrundcf("打开")
                            alldcf=1
                        }else{
                            CMaintenance.dbrundcf("关闭")
                            alldcf=0
                        }
                    }
                }
                CustomButton{
                    x:10*dp+(parent.width-20*dp)/3
                    y:80*dp
                    width: (parent.width-20*dp)/3
                    button_color: "#F2F2F2"
                    button_icon: "qrc:/picture/maintain/txrz.png"
                    title: "通信日志"
                    onReleased: {
                        logwindow.show()
                    }
                }
            }
            Rectangle{
                x:0*dp
                y:parent.height*0.2
                width: parent.width
                height: parent.height*0.8
                border.width: 1
                border.color: "#B8B7B5"
                color: "#E0E6E9"
                PracticeCanvas{
                    anchors.centerIn: parent
                    width: parent.width
                    height: Math.min(parent.height*0.8, parent.width)
                    onVisibleChanged: {
                        if(visible){
                            startAnimation()
                        }else{
                            stopAnimation()
                        }
                    }
                }
                Text {
                    text: qsTr("示意图")
                    font.bold: true
                    font.pixelSize: config.fontsize + 3*dp
                }
            }
        }
    }
    // 主布局
//    Rectangle{
//        x:30*dp
//        y:20*dp
//        width: parent.width-2*x
//        height: parent.height-2*x

//        // 上边 ==========================================
//        Item{
//            id: layout_top
//            height: 180*dp; width: parent.width
//            CustomButton{
//                width: 100*dp
//                height: 100*dp
//                y: 20*dp
//                title: "恢复初始"
//                icon_color: "#56BD6C"
//                button_color: isHovered? "#d9d9d9":"#F2F2F2"
//                iconDirect: 1
//                button_icon:"qrc:/picture/bt_hfcs.png"
//                icon_size:33*dp
//                onReleased: {
//                    qdhfcs.show()
//                }
//            }
//            CustomButton{
//                width: 100*dp
//                height: 100*dp
//                x: 130*dp
//                y: 20*dp
//                title: "复位"
//                icon_color: "#FFA200"
//                button_color: isHovered? "#d9d9d9":"#F2F2F2"
//                iconDirect: 1
//                button_icon:"qrc:/picture/bt_fw.png"
//                icon_size:33*dp
//                onReleased: {
//                    qdfw.show()
//                }
//                CustomTooltip{
//                    visible: parent.isHovered
//                    text: "复位到电机原点"
//                }
//            }
//            CustomButton{
//                width: 100*dp
//                height: 100*dp
//                x: 260*dp
//                y: 20*dp
//                title: "下发"
//                icon_color: "#1677FF"
//                button_color: isHovered? "#d9d9d9":"#F2F2F2"
//                iconDirect: 1
//                button_icon:"qrc:/picture/phwh_xf.png"
//                icon_size:33*dp
//                onReleased: {
//                    qdxf.show()
//                }
//            }
//            CustomButton{
//                width: 100*dp
//                height: 100*dp
//                x: 390*dp
//                y: 20*dp
//                title: "状态获取"
//                icon_color: "#1677FF"
//                button_color: isHovered? "#d9d9d9":"#F2F2F2"
//                iconDirect: 1
//                button_icon:"qrc:/picture/phwh_zthq.png"
//                icon_size:33*dp
//                onReleased: {
//                    statepop.show()
//                }
//            }
//            Rectangle{
//                width: parent.width*0.38
//                height: parent.height
//                x: parent.width*0.62
//                border.color: "#B8B7B5"
//                color: "#E0E6E9"
////                Image {
////                    id: pic1
////                    source: "qrc:/picture/gldb.png"
////                    fillMode: Image.PreserveAspectFit
////                    width: parent.width
////                    height: parent.height
////                }
//                PracticeCanvas{
//                    anchors.centerIn: parent
//                    width: Math.min(parent.width, parent.height*1.4)
//                    height: Math.min(parent.height, parent.width * 0.8)
//                    onVisibleChanged: {
//                        if(visible){
//                            startAnimation()
//                        }else{
//                            stopAnimation()
//                        }
//                    }
//                }
//                MouseArea{
//                    anchors.fill: parent
//                    cursorShape: Qt.PointingHandCursor
//                    onDoubleClicked: {
//                        dbMaintenancePop.show()
//                    }
//                }
////                Rectangle{
////                    x:20*dp
////                    y:10*dp
////                    Text {
////                        text: qsTr("示意图")
////                        font.bold: true
////                        font.pixelSize: config.fontsize + 3*dp
////                    }
////                }
//            }
//        }
//        // 下边
//        Rectangle{
//            id: layout_buttom
//            y: layout_top.height + 10*dp
//            width: parent.width
//            height: parent.height - y
//            radius: 10*dp
//            border.color: "#B8B7B5"

//            // 左半场
//            ScrollView{
//                y:10*dp
//                id: scrollView
//                width: parent.width*0.66
//                height: parent.height-20*dp
//                clip: true

//                Column{
//                    id: columnLayout
//                    x:10*dp
//                    y:40*dp
//                    width: parent.width - 20*dp
//                    height: parent.height-40*dp
//                    Rectangle{
//                        x:20*dp
//                        radius: 8
//                        border.color: "#DEDEDE"  // 边框颜色
//                        border.width: 1
//                        width:  scrollView.width-40*dp
//                        height: 60*dp
//                        Text {
//                            x:20*dp
//                            text: qsTr("维护")
//                            font.bold: true
//                            font.pixelSize: 20
//                            anchors.verticalCenter: parent.verticalCenter
//                        }
//                        PushButton{
//                            x:scrollView.width-120*dp
//                            y:1*dp
//                            width: 36*dp
//                            height: 28*dp
//                            icon_height: 28*dp
//                            icon_width: 36*dp
//                            anchors.verticalCenter: parent.verticalCenter
//                            button_icon:{
//                                if(isHover){
//                                    return "qrc:/picture/ygd.png"
//                                }else{
//                                    if(gdwh===0){
//                                        return "qrc:/picture/wgd.png"
//                                    }else{
//                                        "qrc:/picture/ygd.png"
//                                    }
//                                }
//                            }
//                            onReleased: {
//                                if(gdwh===0){
//                                    gdwh=1
//                                }else{
//                                    gdwh=0
//                                }
//                            }
//                            CustomTooltip{
//                                visible: parent.isHover
//                                text: "固定"
//                            }
//                        }
//                        PushButton{
//                            x:scrollView.width-80*dp
//                            y:1*dp
//                            width: 36*dp
//                            height: 28*dp
//                            icon_height: 28*dp
//                            icon_width: 36*dp
//                            anchors.verticalCenter: parent.verticalCenter
//                            button_icon:flagwh===1?"qrc:/picture/xs.png":"qrc:/picture/xx.png"
//                            onReleased: {
//                                if(flagwh===1){
//                                    if(gdwh===1){
//                                        return
//                                    }
//                                    flagwh=0
//                                }else{
//                                    flagwh=1
//                                    if(gdcs===0){
//                                        flagcs=0
//                                    }
//                                    if(gdwc===0){
//                                        flagwc=0
//                                    }
//                                }
//                            }
//                        }
//                    }
//                    Rectangle{
//                        visible: flagwh===1
//                        x:20*dp
//                        //                        y:200*dp
//                        width: scrollView.width-40*dp
//                        height: 1080*dp
//                        color: "#F9F9F9"
//                        Rectangle{
//                            x:10*dp
//                            y:10*dp
//                            width: parent.width-20*dp
//                            height: 100*dp
//                            color: "white"
//                            CustomDoubleButton{
//                                title: "吸取梭体"
//                                name1: "打开"
//                                name2: "关闭"
//                                x:15*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5+10*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomButtonIcon{
//                                id:visible1_1
//                                button_icon: "qrc:/picture/wh_jiah.png"
//                                width: 38*dp
//                                height: 38*dp
//                                x:(parent.width-120*dp)/5+40*dp
//                                y:31*dp
//                                onReleased: {
//                                    if(button_icon==="qrc:/picture/wh_jiah.png"){
//                                        button_icon="qrc:/picture/wh_jianh.png"
//                                    }else{
//                                        button_icon="qrc:/picture/wh_jiah.png"
//                                    }
//                                }
//                            }

//                            CustomDoubleButton{
//                                visible: visible1_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "负压阀1"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5+100*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible1_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "负压阀2"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5*2+100*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
////                            CustomDoubleButton{
////                                visible: visible1_1.button_icon==="qrc:/picture/wh_jianh.png"
////                                title: "负压阀3"
////                                name1: "开"
////                                name2: "关"
////                                x:(parent.width-120*dp)/5*3+140*dp
////                                y:10*dp
////                                width: (parent.width-120*dp)/5
////                                onBt1: {
////                                    CMaintenance.maintenanceAction(title+name1)
////                                }
////                                onBt2: {
////                                    CMaintenance.maintenanceAction(title+name2)
////                                }
////                            }
//                        }
//                        Rectangle{
//                            x:10*dp
//                            y:120*dp
//                            width: parent.width-20*dp
//                            height: 100*dp
//                            color: "white"
//                            CustomDoubleButton{
//                                title: "梭体上靶"
//                                name1: "上移"
//                                name2: "下移"
//                                x:15*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5+10*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                    CAnimationPractice.feedPortUp()
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                    CAnimationPractice.feedPortDown()
//                                }
//                            }
//                        }
//                        Rectangle{
//                            x:10*dp
//                            y:240*dp
//                            width: parent.width-20*dp
//                            height: 220*dp
//                            color: "white"
//                            CustomDoubleButton{
//                                title: "梭体组合运行"
//                                name1: "一键进靶"
//                                name2: "一键退靶"
//                                x:15*dp
//                                y:70*dp
//                                width: (parent.width-120*dp)/5+10*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                    CAnimationPractice.oneButtonInTarget()
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                    CAnimationPractice.oneButtonOutTarget()
//                                }
//                            }
//                            CustomButtonIcon{
//                                id:visible3_1
//                                button_icon: "qrc:/picture/wh_jiah.png"
//                                width: 38*dp
//                                height: 38*dp
//                                x:(parent.width-120*dp)/5+40*dp
//                                y:91*dp
//                                onReleased: {
//                                    if(button_icon==="qrc:/picture/wh_jiah.png"){
//                                        button_icon="qrc:/picture/wh_jianh.png"
//                                    }else{
//                                        button_icon="qrc:/picture/wh_jiah.png"
//                                    }
//                                }
//                            }
//                            CustomSFourButton{
//                                visible: visible3_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "进靶"
//                                name1: "水冷头旋转(水平)"
//                                name2: "抱闸状态-松开"
//                                name3: "进靶"
//                                name4: "抱闸状态-锁止"
//                                x:(parent.width-120*dp)/5+100*dp
//                                y:10*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(name1)
//                                    CAnimationPractice.turnWheelLeft()
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(name2)
//                                    CAnimationPractice.closeBrake()
//                                }
//                                onBt3: {
//                                    CMaintenance.maintenanceAction(name3)
//                                    CAnimationPractice.barMoveLeft()
//                                }
//                                onBt4: {
//                                    CMaintenance.maintenanceAction(name4)
//                                    CAnimationPractice.openBrake()
//                                }
//                            }
//                            CustomSFourButton{
//                                visible: visible3_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "退靶"
//                                name1: "抱闸状态-松开"
//                                name2: "退靶"
//                                name3: "抱闸状态-锁止"
//                                name4: "水冷头旋转(垂直)"
//                                x:(parent.width-120*dp)/5+360*dp
//                                y:10*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(name1)
//                                    CAnimationPractice.closeBrake()
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(name2)
//                                    CAnimationPractice.barMoveRight()
//                                }
//                                onBt3: {
//                                    CMaintenance.maintenanceAction(name3)
//                                    CAnimationPractice.openBrake()
//                                }
//                                onBt4: {
//                                    CMaintenance.maintenanceAction(name4)
//                                    CAnimationPractice.turnWheelDown()
//                                }
//                            }

//                        }
//                        Rectangle{
//                            x:10*dp
//                            y:470*dp
//                            width: parent.width-20*dp
//                            height: 190*dp
//                            color: "white"
//                            CustomDoubleButton{
//                                x:15*dp
//                                y:55*dp
//                                width: (parent.width-120*dp)/5+10*dp
//                                title: "冷却设置"
//                                name1: "水气全开"
//                                name2: "水气全关"
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                    CAnimationPractice.openPump2()
//                                    CAnimationPractice.openPumpHe()
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                    CAnimationPractice.closePump2()
//                                    CAnimationPractice.closePumpHe()
//                                }
//                            }
//                            CustomButtonIcon{
//                                id:visible4_1
//                                button_icon: "qrc:/picture/wh_jiah.png"
//                                width: 38*dp
//                                height: 38*dp
//                                x:(parent.width-120*dp)/5+40*dp
//                                y:76*dp
//                                onReleased: {
//                                    if(button_icon==="qrc:/picture/wh_jiah.png"){
//                                        button_icon="qrc:/picture/wh_jianh.png"
//                                    }else{
//                                        button_icon="qrc:/picture/wh_jiah.png"
//                                    }
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible4_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "水冷"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5+100*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                    CAnimationPractice.openPump2()
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                    CAnimationPractice.closePump2()
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible4_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "气冷"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5+100*dp
//                                y:100*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                    CAnimationPractice.openPumpHe()
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                    CAnimationPractice.closePumpHe()
//                                }
//                            }
//                            CustomButtonIcon{
//                                visible: visible4_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                id:visible4_2
//                                button_icon: "qrc:/picture/wh_jiah.png"
//                                width: 38*dp
//                                height: 38*dp
//                                x:(parent.width-120*dp)/5*2+100*dp
//                                y:31*dp
//                                onReleased: {
//                                    if(button_icon==="qrc:/picture/wh_jiah.png"){
//                                        button_icon="qrc:/picture/wh_jianh.png"
//                                    }else{
//                                        button_icon="qrc:/picture/wh_jiah.png"
//                                    }
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible4_2.button_icon==="qrc:/picture/wh_jianh.png"&&visible4_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "水路阀2"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 3
//                                x:(parent.width-120*dp)/5*2+160*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-30*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible4_2.button_icon==="qrc:/picture/wh_jianh.png"&&visible4_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "水路阀1"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 3
//                                x:(parent.width-120*dp)/5*3+150*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-30*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible4_2.button_icon==="qrc:/picture/wh_jianh.png"&&visible4_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "水冷机"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 3
//                                x:(parent.width-120*dp)/5*4+140*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-30*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomButtonIcon{
//                                visible: visible4_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                id:visible4_3
//                                button_icon: "qrc:/picture/wh_jiah.png"
//                                width: 38*dp
//                                height: 38*dp
//                                x:(parent.width-120*dp)/5*2+100*dp
//                                y:121*dp
//                                onReleased: {
//                                    if(button_icon==="qrc:/picture/wh_jiah.png"){
//                                        button_icon="qrc:/picture/wh_jianh.png"
//                                    }else{
//                                        button_icon="qrc:/picture/wh_jiah.png"
//                                    }
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible4_3.button_icon==="qrc:/picture/wh_jianh.png"&&visible4_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "氦气阀1"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 3
//                                x:(parent.width-120*dp)/5*2+160*dp
//                                y:100*dp
//                                width: (parent.width-120*dp)/5-30*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible4_3.button_icon==="qrc:/picture/wh_jianh.png"&&visible4_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "氦气阀2"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 3
//                                x:(parent.width-120*dp)/5*3+150*dp
//                                y:100*dp
//                                width: (parent.width-120*dp)/5-30*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }

//                        }
//                        Rectangle{
//                            x:10*dp
//                            y:670*dp
//                            width: parent.width-20*dp
//                            height: 290*dp
//                            color: "white"
//                            CustomDoubleButton{
//                                x:15*dp
//                                y:105*dp
//                                width: (parent.width-120*dp)/5+10*dp
//                                inputflag: 1
//                                title: "干燥时间(分)"
//                                name1: "启动"
//                                name2: "停止"
//                                onBt1: {
//                                    gzsj=inputt
//                                    gzfl=1
//                                    CMaintenance.dry(inputt,"开")
//                                }
//                                onBt2: {
//                                    gzfl=0
//                                    CMaintenance.dry(0,"关")
//                                    // 停止计时
//                                    timer.stop()
//                                    isRunning = false
//                                    CAnimationPractice.closePump1()
//                                }
//                            }
//                            Text {
//                                x:20*dp
//                                width: 60*dp
//                                color: "#999999"
//                                y:225*dp
//                                text: qsTr("距结束")
//                            }
//                            Text {
//                                id:timeid
//                                x:85*dp
//                                width: 90*dp
//                                font.bold: true
//                                font.pointSize: 15
//                                y:220*dp
//                                text: formatTime(remainingSeconds)
//                            }
//                            CustomButtonIcon{
//                                id:visible5_1
//                                button_icon: "qrc:/picture/wh_jiah.png"
//                                width: 38*dp
//                                height: 38*dp
//                                x:(parent.width-120*dp)/5+40*dp
//                                y:126*dp
//                                onReleased: {
//                                    if(button_icon==="qrc:/picture/wh_jiah.png"){
//                                        button_icon="qrc:/picture/wh_jianh.png"
//                                    }else{
//                                        button_icon="qrc:/picture/wh_jiah.png"
//                                    }
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible5_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "水路阀3"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5+100*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible5_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "正压阀2"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5*2+100*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible5_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "正压阀3"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5*3+100*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible5_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "正压阀1"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5*4+100*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible5_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "负压阀1"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5+100*dp
//                                y:100*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible5_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "负压阀2"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5*2+100*dp
//                                y:100*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible5_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "水路阀2"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5*3+100*dp
//                                y:100*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible5_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "氦气阀1"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5*4+100*dp
//                                y:100*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible5_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "氦气阀2"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5+100*dp
//                                y:190*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                        }
//                        Rectangle{
//                            x:10*dp
//                            y:970*dp
//                            width: parent.width-20*dp
//                            height: 100*dp
//                            color: "white"
//                            CustomDoubleButton{
//                                title: "加速端回靶"
//                                name1: "启动"
//                                name2: "停止"
//                                x:15*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5+10*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                    CAnimationPractice.openBlowTarget()
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                    CAnimationPractice.closeBlowTarget()
//                                }
//                            }
//                            CustomButtonIcon{
//                                id:visible6_1
//                                button_icon: "qrc:/picture/wh_jiah.png"
//                                width: 38*dp
//                                height: 38*dp
//                                x:(parent.width-120*dp)/5+40*dp
//                                y:31*dp
//                                onReleased: {
//                                    if(button_icon==="qrc:/picture/wh_jiah.png"){
//                                        button_icon="qrc:/picture/wh_jianh.png"
//                                    }else{
//                                        button_icon="qrc:/picture/wh_jiah.png"
//                                    }
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible6_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "正压阀1"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5+100*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }
//                            CustomDoubleButton{
//                                visible: visible6_1.button_icon==="qrc:/picture/wh_jianh.png"
//                                title: "正压阀3"
//                                name1: "打开"
//                                name2: "关闭"
//                                bttype: 2
//                                x:(parent.width-120*dp)/5*2+100*dp
//                                y:10*dp
//                                width: (parent.width-120*dp)/5-20*dp
//                                onBt1: {
//                                    CMaintenance.maintenanceAction(title+name1)
//                                }
//                                onBt2: {
//                                    CMaintenance.maintenanceAction(title+name2)
//                                }
//                            }

//                        }
//                    }
//                    Rectangle{
//                        height: 10*dp
//                        width: parent.width
//                        x:0*dp
//                    }
//                    Rectangle{
//                        x:20*dp
//                        //                        y:150*dp
//                        width:  scrollView.width-40*dp
//                        height: 60*dp
//                        radius: 8
//                        border.color: "#DEDEDE"  // 边框颜色
//                        border.width: 1
//                        Text {
//                            x:20*dp
//                            text: qsTr("参数校正")
//                            font.bold: true
//                            font.pixelSize: 20
//                            anchors.verticalCenter: parent.verticalCenter
//                        }
//                        PushButton{
//                            x:scrollView.width-120*dp
//                            y:1*dp
//                            width: 36*dp
//                            height: 28*dp
//                            icon_height: 28*dp
//                            icon_width: 36*dp
//                            anchors.verticalCenter: parent.verticalCenter
//                            button_icon:{
//                                if(isHover){
//                                    return "qrc:/picture/ygd.png"
//                                }else{
//                                    if(gdcs===0){
//                                        return "qrc:/picture/wgd.png"
//                                    }else{
//                                        "qrc:/picture/ygd.png"
//                                    }
//                                    //                                    gddb===0?"qrc:/picture/wgd.png":"qrc:/picture/ygd.png"
//                                }
//                            }
//                            onReleased: {
//                                if(gdcs===0){
//                                    gdcs=1
//                                }else{
//                                    gdcs=0
//                                }
//                            }
//                            CustomTooltip{
//                                visible: parent.isHover
//                                text: "固定"
//                            }
//                        }
//                        PushButton{
//                            x:scrollView.width-80*dp
//                            y:1*dp
//                            width: 36*dp
//                            height: 28*dp
//                            icon_height: 28*dp
//                            icon_width: 36*dp
//                            anchors.verticalCenter: parent.verticalCenter
//                            button_icon:flagcs===1?"qrc:/picture/xs.png":"qrc:/picture/xx.png"
//                            onReleased: {
//                                if(flagcs===1){
//                                    if(gdcs===1){
//                                        return
//                                    }
//                                    flagcs=0
//                                }else{
//                                    flagcs=1
//                                    if(gdwh===0){
//                                        flagwh=0
//                                    }
//                                    if(gdwc===0){
//                                        flagwc=0
//                                    }
//                                }
//                            }
//                        }
//                    }
//                    Rectangle{
//                        visible: flagcs===1
//                        x:20*dp
//                        color: "#F9F9F9"
//                        //                        y:200*dp
//                        width: scrollView.width-40*dp
//                        height: 160*dp
//                        Rectangle{
//                            x:0*dp
//                            y:20*dp
//                            width: parent.width
//                            height: 40*dp
//                            color: "transparent"
//                            CustomComboBox{
//                                id:hqtype
//                                x:20*dp
//                                y:20*dp
//                                editWidth: 120*dp
//                                model: ["开阀门","关阀门"]
//                            }

//                            CustomInputText{
//                                id:hqvalue
//                                x:200*dp
//                                y:20*dp
//                                title: "氦气泵压力值"
//                                titleWidth: 100*dp
//                                editWidth: 80*dp
//                            }
//                            CustomButton{
//                                x:parent.width-220*dp
//                                y:20*dp
//                                width: 100*dp
//                                defaultMode1: true
//                                title: "读取"
//                                onReleased: {
//                                    CMaintenance.getHqAir(hqtype.getText())
//                                }
//                            }
//                            CustomButton{
//                                x:parent.width-110*dp
//                                y:20*dp
//                                width: 100*dp
//                                defaultMode1: true
//                                title: "写入"
//                                onReleased: {
//                                    CMaintenance.setHqAir(hqtype.getText(),hqvalue.getText())
//                                }
//                            }
//                        }
//                        Rectangle{
//                            x:0*dp
//                            y:80*dp
//                            width: parent.width
//                            height: 40*dp
//                            color: "transparent"
//                            CustomComboBox{
//                                id:xqbtype
//                                x:20*dp
//                                y:20*dp
//                                editWidth: 120*dp
//                                model: ["开阀门","关阀门"]
//                            }

//                            CustomInputText{
//                                id:xqbvalue
//                                x:200*dp
//                                y:20*dp
//                                title: "吸取靶材压力值"
//                                titleWidth: 100*dp
//                                editWidth: 80*dp
//                            }
//                            CustomButton{
//                                x:parent.width-220*dp
//                                y:20*dp
//                                width: 100*dp
//                                defaultMode1: true
//                                title: "读取"
//                                onReleased: {
//                                    CMaintenance.getXqbAir(xqbtype.getText())
//                                }
//                            }
//                            CustomButton{
//                                x:parent.width-110*dp
//                                y:20*dp
//                                width: 100*dp
//                                defaultMode1: true
//                                title: "写入"
//                                onReleased: {
//                                    CMaintenance.setXqbAir(xqbtype.getText(),xqbvalue.getText())
//                                }
//                            }
//                        }

//                    }
//                    Rectangle{
//                        height: 10*dp
//                        width: parent.width
//                        x:0*dp
//                    }
//                    Rectangle{
//                        x:20*dp
//                        //                        y:150*dp
//                        width:  scrollView.width-40*dp
//                        height: 60*dp
//                        radius: 8
//                        border.color: "#DEDEDE"  // 边框颜色
//                        border.width: 1
//                        Text {
//                            x:20*dp
//                            text: qsTr("无参校正")
//                            font.bold: true
//                            font.pixelSize: 20
//                            anchors.verticalCenter: parent.verticalCenter
//                        }
//                        PushButton{
//                            x:scrollView.width-120*dp
//                            y:1*dp
//                            width: 36*dp
//                            height: 28*dp
//                            icon_height: 28*dp
//                            icon_width: 36*dp
//                            anchors.verticalCenter: parent.verticalCenter
//                            button_icon:{
//                                if(isHover){
//                                    return "qrc:/picture/ygd.png"
//                                }else{
//                                    if(gdwc===0){
//                                        return "qrc:/picture/wgd.png"
//                                    }else{
//                                        "qrc:/picture/ygd.png"
//                                    }
//                                    //                                    gddb===0?"qrc:/picture/wgd.png":"qrc:/picture/ygd.png"
//                                }
//                            }
//                            onReleased: {
//                                if(gdwc===0){
//                                    gdwc=1
//                                }else{
//                                    gdwc=0
//                                }
//                            }
//                            CustomTooltip{
//                                visible: parent.isHover
//                                text: "固定"
//                            }
//                        }
//                        PushButton{
//                            x:scrollView.width-80*dp
//                            y:1*dp
//                            width: 36*dp
//                            height: 28*dp
//                            icon_height: 28*dp
//                            icon_width: 36*dp
//                            anchors.verticalCenter: parent.verticalCenter
//                            button_icon:flagwc===1?"qrc:/picture/xs.png":"qrc:/picture/xx.png"
//                            onReleased: {
//                                if(flagwc===1){
//                                    if(gdwc===1){
//                                        return
//                                    }
//                                    flagwc=0
//                                }else{
//                                    flagwc=1
//                                    if(gdwh===0){
//                                        flagwh=0
//                                    }
//                                    if(gdcs===0){
//                                        flagcs=0
//                                    }
//                                }
//                            }
//                        }
//                    }
//                    Rectangle{
//                        visible: flagwc===1
//                        x:20*dp
//                        color: "#F9F9F9"
//                        //                        y:200*dp
//                        width: scrollView.width-40*dp
//                        height: 80*dp
//                        Rectangle{
//                            x:0*dp
//                            y:20*dp
//                            width: parent.width
//                            height: 40*dp
//                            color: "transparent"
//                            CustomInputText{
//                                id:dbqdyl
//                                title: "气道压力"
//                                x:10*dp
//                                titleWidth: 100*dp
//                                editWidth: 100*dp
//                            }
//                            CustomInputText{
//                                id:dbxbyl
//                                title: "吸靶压力"
//                                x:210*dp
//                                titleWidth: 100*dp
//                                editWidth: 100*dp
//                            }
//                            CustomInputText{
//                                id:dbhqyl
//                                title: "氦气压力"
//                                x:410*dp
//                                titleWidth: 100*dp
//                                editWidth: 100*dp
//                            }
//                            CustomButton{
//                                title: "获取"
//                                width: 100*dp
//                                x:parent.width-110*dp
//                                defaultMode1: true
//                                onReleased: {
//                                    CMaintenance.getZBxpyl()
//                                    CMaintenance.getDBhqyl()
//                                }
//                            }
//                        }


//                    }
//                    Rectangle{
//                        x:0*dp
//                        //                        y:50*dp
//                        width: scrollView.width
//                        height: 40*dp
//                    }
//                }
//            }

//            Rectangle{ // 中间的竖线
//                x: parent.width*0.67
//                width: 1*dp
//                height: parent.height
//                color: "#B8B7B5"
//            }
//            // 右半场
//            Item{
//                x: parent.width * 0.68
//                width: parent.width * 0.31
//                height: parent.height
//                Rectangle{
//                    y:20*dp; x: 20*dp
//                    Text {
//                        text: qsTr("通信日志")
//                        font.bold: true
//                        font.pixelSize: config.fontsize + 3*dp
//                    }
//                }
//                PushButton{
//                    x:parent.width-140*dp
//                    y:20*dp
//                    button_icon: "qrc:/picture/br_qc.png"
//                    title: "清除"
//                    width: 60*dp
//                    text_color: "#1677FF"
//                    icon_height: 20*dp
//                    icon_width: 20*dp
//                    onReleased: {
//                        CMaintenance.delLog()
//                    }
//                }
//                PushButton{
//                    x:parent.width-70*dp
//                    y:20*dp
//                    button_icon: "qrc:/picture/bt_dc.png"
//                    title: "导出"
//                    width: 60*dp
//                    text_color: "#1677FF"
//                    icon_height: 20*dp
//                    icon_width: 20*dp
//                    onReleased: {
//                        CMaintenance.exportLog()
//                    }
//                }
//                Rectangle{
//                    x: 20*dp
//                    y:65*dp
//                    color: "#B8B7B5"
//                    width: parent.width-2*x
//                    height: parent.height-70*dp
//                    DataLog{
//                        id:logtab
//                    }
//                }
//            }
//        }
//    }


    Toast{
        id: maintenanceToast
        x: (parent.width-width) * 0.5
        y: 100*dp
    }

}
